package jrunner;
	import javax.swing.*;
	import java.awt.*;
import java.awt.event.*;


public class GUI extends JFrame{

		
	private JButton buttonsync;
    private JButton buttonstart;
    private JPanel panelButton;
    private JLabel oben;
    private JLabel showtext;	   
	

	public GUI()
    {
        super("JRUNNER");
        setSize(500,500);
        setLocation(300,300);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        getContentPane().setLayout(new BorderLayout(5,5));

        //create Buttons
        buttonsync = new JButton("Syncronize Data");
        
        buttonstart = new JButton("start JRunner");
        buttonstart.addActionListener(new startJRunnerButton());

        //create Panels
        panelButton = new JPanel(new GridLayout(1,2));

        //put Buttons on panel
        panelButton.add(buttonstart);
        panelButton.add(buttonsync); 

        //create Labels
        oben = new JLabel("JRunner 1.0");
        //centralize Labels
        oben.setHorizontalAlignment(JLabel.CENTER); 
        showtext = new JLabel("please Choose");

        //put Labels on Frame
        getContentPane().add(BorderLayout.SOUTH, oben);
        getContentPane().add(showtext);

        //put Panels on Frame
        getContentPane().add(BorderLayout.WEST, panelButton);

        pack();                    //sieht das Fenster ohne diesen Befehl deiner Meinung nach besser aus? 
        setVisible(true);

    }

    public static void main(String[] args)
    {
        GUI window = new GUI();
    }

    class startJRunnerButton implements ActionListener{

		public void actionPerformed(ActionEvent ev) {
			startWindow2 newwindow= new startWindow2("JRunner Startpage"); //open JRunner Startpage
		    newwindow.createAndShowGUI();
			
		}		
	}
    
}
